package lihao;

public class Test11 {
    public static void main(String[] args) {
        int[] arr = new int[]{10, 8, 5, 3, 27, 99};
        System.out.println(getCoin(arr));
    }

    public static int getCoin(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            int num = arr[i];
            if (num % 2 == 0) {
                count += num / 2;
            } else {
                count += num / 2 + 1;
            }
        }
        return count;
    }
}
